package cn.edu.cjw.APMFP.ui;

import javax.swing.*;
import java.awt.*;

/**
 * @package cn.edu.cjw.APMFP.ui
 * @className MainFrame
 * @note 主界面
 * @author wind
 * @date 2022/3/10 20:02
 */
public class MainFrame extends JFrame {

    /**
     * 头部面板
     */
    protected final TopPanel topPanel = new TopPanel(this);
    /**
     * 中心面板
     */
    protected final CenterPanel centerPanel = new CenterPanel(this);

    public MainFrame(){
        setTitle("主界面");
        init();
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setLocationRelativeTo(null);
        setSize(900, 600);
        setVisible(true);
    }

    /**
     * 初始化组件
     */
    public void init(){
        setLayout(new BorderLayout(10, 10));
        add(topPanel, BorderLayout.NORTH);
        add(centerPanel, BorderLayout.CENTER);
    }

    public static void main(String[] args) {
        // 设置界面样式 Look And Feel
        try {
            UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
        } catch(Exception ex) {
            ex.printStackTrace();
        }
        new MainFrame();
    }
}
